<template>
	<view style="background-color: #f5f5f5;">
		<view style="background-color: #fff;padding:20rpx;">
			<view
				style="background-color: #2D80E3;padding: 40rpx;border-radius: 20rpx; box-shadow: 1rpx 1rpx 20rpx #2D80E3">
				<view
					style="display: flex;flex-direction: row; justify-content: space-around;margin-bottom: 40rpx;">
					<view class="team_top_item" @click="openPage('pages/team/team', {user_id: id})">
						<text class="team_top_item_num">{{user.recommend.direct.user_num + user.recommend.indirect.user_num}}</text>
						<text class="team_top_item_title">总人数</text>
					</view>
					
				</view>
				<view style="display: flex;flex-direction: row; justify-content: space-around;">
					<view class="team_men_item">
						<text class="team_men_item_num">{{user.recommend.todayChild}}</text>
						<text class="team_men_item_title">今日注册</text>
					</view>
					<!-- <view class="team_men_item">
						<text class="team_men_item_num">{{user.recommend.indirect.user_num}}</text>
						<text class="team_men_item_title">间推用户</text>
					</view> -->
					<view class="team_men_item">
						<text class="team_men_item_num">{{user.recommend.direct.real_name_num + user.recommend.indirect.real_name_num}}</text>
						<text class="team_men_item_title">实名用户</text>
					</view>
				</view>
		
				<view style="margin-top: 40rpx;">
					<gewu-subsection :list="subsection" :current="curNow" @change="sectionChange"
						active-color="#fff" bg-color="#fff" button-color="#2D80E3"></gewu-subsection>
				</view>
			</view>
			
		
			<!-- <view style="display: flex;justify-content: center;margin-top: 20rpx;">
				<view style="width: 100%; margin: 0 20rpx;">
					<u-search placeholder="搜索用户姓名或者电话" height="60" searchIconSize="38" v-model="search" :show-action="false" @search="searchFn"></u-search>
				</view>
				<u-checkbox-group @change="checkboxGroupChange">
					<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in radio"
						:key="index" :name="item.name">{{item.name}}</u-checkbox>
				</u-checkbox-group>
			</view> -->
		</view>
		
		<view style="background-color: #fff;padding: 22rpx 32rpx;margin: 20rpx;">
			
			<view v-if="user != null">
				<!-- <view style="display: flex;flex-direction: row;align-items: center;justify-content: space-around; padding: 80rpx 0;">
					<view style="display: flex;flex-direction: column;align-items: center;justify-content: center;" @click="openPage('pages/team/team', {user_id: id})">
						<text style="font-size: 40rpx; color: #378EFB;">{{user.recommend.direct.user_num + user.recommend.indirect.user_num}}</text>
						<text style="color: #8E8E93;font-size: 24rpx;">总用户数</text>
					</view>
					<view>
						<u-line class="u-line" direction="col" length="94" color="#E6E3E6"></u-line>
					</view>
					<view style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
						<text style="font-size: 40rpx; color: #378EFB;">{{user.recommend.todayChild}}</text>
						<text style="color: #8E8E93;font-size: 24rpx;">今日注册</text>
					</view>
				</view> -->
				
				<view style="display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-between;">
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.user_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.user_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, real_name_status: 1})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推实名用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.real_name_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, real_name_status: 1})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推实名用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.real_name_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, real_name_status: 0})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推未实名用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.user_num - user.recommend.direct.real_name_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, real_name_status: 0})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推未实名用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.user_num - user.recommend.indirect.real_name_num}}</text>
					</view>
				</view>
				
				<view style="display: flex;flex-direction: row;flex-wrap: wrap;justify-content: space-between;">
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, level: 1})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推VIP1用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.level1_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, level: 1})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推VIP1用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.level1_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, level: 2})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推VIP2用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.level2_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, level: 2})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推VIP2用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.level2_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, level: 3})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推VIP3用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.level3_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, level: 3})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推VIP3用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.level3_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, level: 4})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推VIP4用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.level4_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, level: 4})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推VIP4用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.level4_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, level: 5})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推VIP5用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.level5_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, level: 5})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推VIP5用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.level5_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, direct: 1, level: 6})">
						<text style="color: #8E8E93;font-size: 24rpx;">直推VIP6用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.direct.level6_users_num}}</text>
					</view>
					<view class="item" @click="openPage('pages/team/team', {user_id: id, indirect: 1, level: 6})">
						<text style="color: #8E8E93;font-size: 24rpx;">间推VIP6用户</text>
						<text style="color: #2e2e2e;font-size: 28rpx;">{{user.recommend.indirect.level6_users_num}}</text>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import { directChildInfo } from '@/common/team.api.js';
	export default {
		data() {
			return {
				id: 0,
				user: null
			}
		},
		onLoad({id}) {
			this.id = id
			
			this.getData()
		},
		methods: {
			openPage(path, params) {
				this.$u.route({
					url: path,
					params
				})
			},
			
			getData() {
				let that = this;
				let params= {
					users_id: this.id
				};
				directChildInfo(params).then(res => {
					this.user = res
				})
			},
		}
	}
</script>

<style lang="less">
	page{
		height: 100vh;
		background-color: #f5f5f5;
	}
	.item{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		background-color: rgba(55, 142, 251, 0.05);
		width: 254rpx;
		height: 80rpx;
		border-radius: 10rpx;
		align-items: center;
		padding: 0 30rpx;
		margin-bottom: 20rpx;
	}
	
	.team_top_item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	
	.team_top_item_num {
		color: #fff;
		font-size: 36rpx;
		margin-bottom: 10rpx;
	}
	
	.team_top_item_title {
		color: #fff;
		font-size: 28rpx;
	}
	
	.team_men_item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	
	.team_men_item_num {
		color: #fff;
		font-size: 24rpx;
		margin-bottom: 10rpx;
	}
	
	.team_men_item_title {
		color: #fff;
		font-size: 28rpx;
	}
	
	.team-user-count-item {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	
	.team-user-count-item-title {
		color: #999;
		font-size: 28rpx;
	}
	
	.team-user-count-item-num {
		color: #d8d673;
		font-size: 24rpx;
		margin-top: 10rpx;
	}
</style>
